<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>修改会员等级信息</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_memberAdd.css">
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
</head>

<body>
	<div class="page_wraper">
		<div id="tab1_0" fortab="tab1">
			<form action="" method="post" id="memberAdd_form">
				<input name="id" type="hidden" id="id" value="{$data.id}">
				<table cellpadding="0" cellspacing="0" class="module_form" width="600">
					<tr>
						<td class="ele_title"><label for="title">会员等级名称：<em>*</em></label></td>
						<td class="ele_content">
							<input name="title" type="text" id="title" value="{$data.title}" class="form_ele_text width_200">
						</td>
						<td class="ele_title"><label for="prefix">会员等级前缀：<em>*</em></label></td>
						<td class="ele_content">
							<input name="prefix" type="text" id="prefix" value="{$data.prefix}" class="form_ele_text width_200">
						</td>
					</tr>
					<tr>
						<td class="ele_title"><label for="init_money">初始赠送金额：</label></td>
						<td class="ele_content">
							<input name="init_money" type="text" id="init_money" value="{$data.init_money}" class="form_ele_text width_200"></td>
						<td class="ele_title"><label for="discount">会员等级折扣：<em>*</em></label></td>
						<td class="ele_content" colspan="3">
							<input name="discount" type="text" id="discount" value="{$data.discount}" class="form_ele_text width_200">
						</td>
					</tr>
					<tr>
						<td class="ele_title"><label for="init_jifen">初始赠送积分：</label></td>
						<td class="ele_content">
							<input name="init_jifen" type="text" id="init_jifen" value="{$data.init_jifen}" class="form_ele_text width_200">
						</td>
						<td class="ele_title"><label for="clear">清零方式：</label></td>
						<td class="ele_content">
							<select name="clear" id="clear">
								<eq name="data.clear" value="1">
									<option value="1" selected="selected">月</option>
								<else />
									<option value="1">月</option>
								</eq>
								<eq name="data.clear" value="2">
									<option value="2" selected="selected">年</option>
								<else />
									<option value="2">年</option>
								</eq>
								<eq name="data.clear" value="3">
									<option value="3" selected="selected">季度</option>
								<else />
									<option value="3">季度</option>
								</eq>
								<eq name="data.clear" value="4">
									<option value="4" selected="selected">永不</option>
								<else />
									<option value="4">永不</option>
								</eq>
								
							</select>
						</td>
					</tr>
					<tr>
						<td class="ele_title"><label for="privileged">会员等级特权：</label></td>
						<td class="ele_content" colspan="3">
							<textarea name="privileged" id="privileged" style="width:400px;height:80px;"  class="form_ele_text width_200">{$data.privileged}</textarea>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
	<div class="page_footer pdtd10">
		<input type="button" name="submit" value="确认修改"  class="form_ele_submit"/>
		<input type="reset" name="reset" value="重置表单"  class="form_ele_reset"/>
	</div>
</body>
<script type="text/javascript">
	//弹出窗口全局变量
	var api = frameElement.api, W = api.opener;

	$(function(){
		//重置
		$('.form_ele_reset').on('click',function(){
			$('#memberAdd_form').get(0).reset();
		});
		
		//提交
		$('.form_ele_submit').on('click',function(){
			
			var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
			
			//通过Ajax提交表单
			var postData = {};
			postData.id          =  $('#id').val(); //获取分组名称
			postData.title       =  $('#title').val(); //获取分组名称
			postData.prefix      =  $('#prefix').val(); //获取分组名称
			postData.discount    =  $('#discount').val(); //获取分组名称
			postData.attr        =  $('#attr').val(); //获取分组名称
			postData.init_jifen  =  $('#init_jifen').val(); //获取分组名称
			postData.init_money  =  $('#init_money').val(); //获取分组名称
			postData.privileged  =  $('#privileged').val(); //获取分组名称
			postData.instruction =  $('#instruction').val(); //获取分组名称
			postData.clear       =  $('#clear').val(); //获取分组名称
			
			//console.log(postData);
			$.post("{:U('Custom/levelEdit')}", postData , function(data){
				if(data.status==1){
					windowApi.lhgdialog.tips('数据修改成功！');
					frameApi.close(); //关闭当前窗口
					var obj = windowApi.lhgdialog.list['Custom_level'];
					obj.reload(obj);
				}else{
					windowApi.lhgdialog.alert(data.info);
				}
			});
		});
	});
</script>
</html>
